﻿using System.Collections.Generic;

namespace com.binance.client.model.enums
{
	 

	public sealed class PeriodType
	{
		public static readonly PeriodType _5m = new PeriodType("_5m", InnerEnum._5m, "5m");
		public static readonly PeriodType _15m = new PeriodType("_15m", InnerEnum._15m, "15m");
		public static readonly PeriodType _30m = new PeriodType("_30m", InnerEnum._30m, "30m");
		public static readonly PeriodType _1h = new PeriodType("_1h", InnerEnum._1h, "1h");
		public static readonly PeriodType _2h = new PeriodType("_2h", InnerEnum._2h, "2h");
		public static readonly PeriodType _4h = new PeriodType("_4h", InnerEnum._4h, "4h");
		public static readonly PeriodType _6h = new PeriodType("_6h", InnerEnum._6h, "6h");
		public static readonly PeriodType _12h = new PeriodType("_12h", InnerEnum._12h, "12h");
		public static readonly PeriodType _1d = new PeriodType("_1d", InnerEnum._1d, "1d");

		private static readonly IList<PeriodType> valueList = new List<PeriodType>();

		static PeriodType()
		{
			valueList.Add(_5m);
			valueList.Add(_15m);
			valueList.Add(_30m);
			valueList.Add(_1h);
			valueList.Add(_2h);
			valueList.Add(_4h);
			valueList.Add(_6h);
			valueList.Add(_12h);
			valueList.Add(_1d);
		}

		public enum InnerEnum
		{
			_5m,
			_15m,
			_30m,
			_1h,
			_2h,
			_4h,
			_6h,
			_12h,
			_1d
		}

		public readonly InnerEnum innerEnumValue;
		private readonly string nameValue;
		private readonly int ordinalValue;
		private static int nextOrdinal = 0;

		private readonly string code;

		internal PeriodType(string name, InnerEnum innerEnum, string code)
		{
			this.code = code;

			nameValue = name;
			ordinalValue = nextOrdinal++;
			innerEnumValue = innerEnum;
		}


		public string Code
		{
			get
			{
				return code;
			}
		}

		public override string ToString()
		{
			return code;
		}

//JAVA TO C# CONVERTER NOTE: Fields cannot have the same name as methods:EnumLookup

		public static IList<PeriodType> values()
		{
			return valueList;
		}

		public int ordinal()
		{
			return ordinalValue;
		}

		public static PeriodType valueOf(string name)
		{
			foreach (PeriodType enumInstance in PeriodType.valueList)
			{
				if (enumInstance.nameValue == name)
				{
					return enumInstance;
				}
			}
			throw new System.ArgumentException(name);
		}
	}

}